/**
    JavaScript module for KB Main page.
    TODO: Add handler for ajax errors
*/
Status = function() {
	/** Private */
	var _statusDialog = null;
	var _messageElement = null;
        
    return {
		/** Public */
        init : function(divElement, messageElement) {
			_messageElement = messageElement;
            _statusDialog = divElement.dialog({
				dialogClass: 'no-close no-title',
				stack: true,
				draggable: false,
				resizable: false,
				height: 'auto',
				autoOpen: false,
				minHeight: 0,
				width: 350,
				modal: true // Creates semi-transparent overlay
			});
        },
		
		show: function(message) {
			_messageElement.text(message);
			_statusDialog.dialog('open');
		},
		
		hide: function() {
			_statusDialog.dialog('close');
		}
    }
}();
    
    